function CombiColumnChart(chartDiv,title,xaxisName,yaxisName,seriesMap,dataMap){
	this.chartDiv=chartDiv;
	this.title=title;
	this.xaxisName=xaxisName;
	this.yaxisName=yaxisName;
	this.dataMap=dataMap;
	this.seriesNameA ="";
	this.seriesNameB="";
	this.seriesMap = seriesMap;
	this.dataMap=dataMap;
	this.seriesNameArray ={};
	this.seriesProKeyArray={};
	this.numberSuffix="";
	this.showTotal = 0;
	this.type = 0;
	this.labelName="";
	this.toCompareQuality = false;
	this.toCompareArmor = false;
};

CombiColumnChart.prototype.setNumberSuffix = function(numberSuffix){
	this.numberSuffix=numberSuffix;
};

CombiColumnChart.prototype.setSeriesName = function(seriesNameA,seriesNameB){
	this.seriesNameA=seriesNameA;
	this.seriesNameB=seriesNameB;
};

CombiColumnChart.prototype.setLabelName = function(labelName){
	this.labelName = labelName;
};

CombiColumnChart.prototype.setKeyPattern = function(keyPattern){
	this.keyPattern = keyPattern;
};

CombiColumnChart.prototype.seCompareQuality = function(bool){
	this.toCompareQuality = bool;
};

CombiColumnChart.prototype.setCompareArmor = function(bool){
	this.toCompareArmor = bool;
};

CombiColumnChart.prototype.setSeriesArray = function(seriesProKeyArray,seriesNameArray){
	this.seriesProKeyArray = seriesProKeyArray;
	this.seriesNameArray = seriesNameArray;
};

CombiColumnChart.prototype.generateDataString = function(){
	this.chartString ="<chart caption='"+this.title+"' xaxisname='"+this.xaxisName+"' YAxisName='"+this.yaxisName+"' sNumberSuffix='%' baseFontSize='12' showValues='0' numberSuffix='"+this.numberSuffix+"' anchorRadius='5' lineThickness='2' formatNumber='0' formatNumberScale='0' palette='3'>";
	this.chartString +="<categories>";
	for(var i in this.seriesMap){
		//var key = this.seriesMap[i];
		var label= this.seriesMap[i]+this.labelName;
		this.chartString+="<category label='"+label+"' />";
	}
	this.chartString +="</categories>";
	if(this.toCompareQuality||this.toCompareArmor){
		this.chartString +="<dataset>";	
	}
	
	var seriesLenght = this.seriesProKeyArray.length;
	var showSeries = true;
	if(seriesLenght<1){
		showSeries = false;
	}
	for(var i = 0;i<seriesLenght;i++){
		  var seriesName = this.seriesNameArray[i];
		  var linkString ="";
		  if(this.toCompareQuality){
			for(var j in itemqualityMap.keys()){
				var q = itemqualityMap.keys()[j];
				this.chartString +="<dataSet";
				var name = itemqualityMap.get(q)+"("+seriesName+")";
				this.chartString+=" seriesName='"+name+"'"
				this.chartString+=">";
				for(var k in this.seriesMap){
					//var key0 = this.seriesMap.keys()[k];
					var key = this.keyPattern.replace("{2}",this.seriesProKeyArray[i]);
					key = key.replace("{1}",q);
					key = key.replace("{0}",k);
					if(battle=='0'){
						linkString = "link='JavaScript:loadChart("+k+","+this.seriesProKeyArray[i]+");'";
					}
					
					var value = this.dataMap[key];
					if (value == undefined){
						value =0;
					}
		    		this.chartString+="<set value='"+value+"' " + linkString+"/>";
				}
				this.chartString +="</dataSet>";
			}
		  }
		  else{
			  this.chartString +="<dataSet";
			  this.chartString+=" seriesName='"+seriesName+"'";
				this.chartString+=">";
				for(var j in this.seriesMap){
					var key = this.keyPattern.replace("{2}",this.seriesProKeyArray[i]);
					var key0 = j;
					key = key.replace("{0}",key0);
					key = key.replace("{1}","0");
					if(battle=='0'){
						linkString = "link='JavaScript:loadChart("+j+","+this.seriesProKeyArray[i]+");'";
					}
					
					var value = this.dataMap[key];
					if (value === undefined){
						value =0;
					}
		    		this.chartString+="<set value='"+value+"'  " + linkString+" />";
				}
			  this.chartString +="</dataSet>";
		  }
	    }
	if(this.toCompareQuality||this.toCompareArmor){
		this.chartString +="</dataset>";
	}
 
	this.chartString +="</chart>";
};

CombiColumnChart.prototype.draw = function(stack){
	this.generateDataString();
	var charStr = "../static/FusionCharts/ScrollColumn2D.swf";
	if(stack){
		charStr = "../static/FusionCharts/MSStackedColumn2DLineDY.swf";
	}
	var chart = new FusionCharts(charStr, "ChartId", "726", "350", "0", "0");
    chart.setXMLData(this.chartString);
    chart.render(this.chartDiv);
};

